<form [formGroup]="form">
  <ix-fieldset [title]="'Authentication' | translate">
    @if (isStigMode() && isNewUser()) {
      <ix-radio-group
        formControlName="stig_password"
        [label]="'Password' | translate"
        [required]="true"
        [options]="stigPasswordOptions$"
      ></ix-radio-group>
    } @else {
      <ix-slide-toggle
        formControlName="password_disabled"
        [label]="'Disable Password' | translate"
        [tooltip]="tooltips.password_disabled | translate"
      ></ix-slide-toggle>

      <ix-slide-toggle
        formControlName="show_password"
        [label]="isNewUser() ? ('Set Password' | translate) : ('Change Password' | translate)"
        [tooltip]="tooltips.password | translate"
      ></ix-slide-toggle>

      @if (form.value.show_password) {
        <ix-input
          formControlName="password"
          type="password"
          [label]="isNewUser() ? ('Password' | translate) : ('New Password' | translate)"
          [tooltip]="(isNewUser() ? tooltips.password : tooltips.password_edit) | translate"
          [required]="isNewUser()"
        ></ix-input>

        <ix-input
          formControlName="password_conf"
          type="password"
          [label]="isNewUser() ? ('Confirm Password' | translate) : ('Confirm New Password' | translate)"
          [required]="isNewUser()"
        ></ix-input>
      }
    }

    @if (sshAccessEnabled()) {
      <ix-checkbox
        formControlName="allow_ssh_login_with_password"
        [label]="'Allow SSH Login with Password (not recommended)' | translate"
      ></ix-checkbox>
      <ix-textarea
        class="ssh_key"
        formControlName="ssh_key"
        [label]="'Public SSH Keys' | translate"
      ></ix-textarea>
    }
  </ix-fieldset>
</form>
